<template>
	<view class="mypop">
		<u-popup :show="showPop" mode="bottom" height="350px" customStyle="width:100%" :round="10">
			<view class="p-3">
				<view class="" style='position: absolute;right: 40rpx;z-index: 10;'>
					<u-icon name="close" size="20" @click="refuse"></u-icon>
				</view>
				<view class="title" style="text-align: center;color: #081738;font-weight: 500;">
					{{title}}
				</view>
				<scroll-view scroll-y="false" style="height: 350px;">
					<view class="scroll-content">
						<view class="top">
							<view class="item">
								<view class="top1">
									4/4
								</view>
								<view class="top2">
									空闲机器
								</view>
							</view>
							<view class="item">
								<view class="top1">
									24
								</view>
								<view class="top2">
									小时营业
								</view>
							</view>
							<view class="item">
								<view class="top1">
									9.45km
								</view>
								<view class="top2">
									位置距离
								</view>
							</view>
						</view>
						<view class="center">
							<view class="parkAmount">
								<view class="icon">
									<image src="../../static/icon/nearCar/dolores.png" mode=""></image>
								</view>
								<view class="content">
									停车场收取外来车辆停车费
								</view>
							</view>
							<view class="parkAmount">
								<view class="icon">
									<image src="../../static/icon/nearCar/map.png" mode=""></image>
								</view>
								<view class="content">
									成都市锦江区汇融广场B座停车场
								</view>
							</view>
						</view>
						<view class="center">
							<view class="parkAmount">
								<view class="icon">
									<image src="../../static/icon/nearCar/car2.png" mode=""></image>
								</view>
								<view class="content">
									洗车卡：6分钟内6元，超出按1元/分钟计费
								</view>
							</view>
							<view class="parkAmount">
								<view class="icon">
									<image src="../../static/icon/nearCar/dollar2.png" mode=""></image>
								</view>
								<view class="content">
									洗车券：洗1次消费一张券
								</view>
							</view>
						</view>
					</view>
				</scroll-view>
				<view class="f-row jc-e">
					<view style="width: 30%;margin-right: 20rpx;">
						<u-button class="custom-style" text="分享好友" openType="getPhoneNumber"
							@getphonenumber="getPhoneNumber" icon="share" color="#fff"
							customStyle="background: linear-gradient(90deg, #2CB9A4 0%, #2CB9A4 100%);color:#fff;margin-top:20px;border-radius: 10px;">
						</u-button>
					</view>
					<view style="width: 30%;">
						<u-button class="custom-style" text="前往洗车" openType="getPhoneNumber"
							@getphonenumber="getPhoneNumber" icon="list-dot" color="#fff"
							customStyle="background: linear-gradient(90deg, #2CB9A4 0%, #2CB9A4 100%);color:#fff;margin-top:20px;border-radius: 10px;">
						</u-button>
					</view>
				</view>
			</view>
		</u-popup>
	</view>
</template>

<script>
	import {
		getWxPhone
	} from '@/request/api.js'
	export default {
		props: ['showPop', 'title', 'tip'],
		data() {
			return {
				show: false,
				value: ''
			}
		},
		methods: {
			// 注意返回值为一个数组，单列时取数组的第一个元素即可(只有一个元素)
			submit(e) {
				this.$emit('submit', this.value)
				this.value = ''
			},
			refuse() {
				this.$emit('refuse', true)
			},
			getPhoneNumber(e) {
				// console.log(e.detail.code)
				getWxPhone({
					code: e.detail.code,
					type: 0
				}).then(res => {
					this.$emit('submit')
				})
			}
		}
	}
</script>

<style scoped lang="scss">
	::v-deep .u-icon {
		display: inline !important;
	}
	
	.mypop {
		width: 90%;
	}

	.scroll-content {
		display: flex;
		flex-direction: column;

		.top {
			display: flex;
			justify-content: space-between;
			margin-top: 40rpx;
			border-bottom: 0.5rpx solid rgba(217, 217, 217, 0.6);
			padding-bottom: 40rpx;

			.item {
				text-align: center;
				background: #F6F6F6;
				padding: 20rpx 40rpx;
				border-radius: 8px;

				.top1 {
					color: #081738;
					font-size: 34rpx;
				}

				.top2 {
					color: #979797;
					font-size: 28rpx;
				}
			}
		}

		.center {
			border-bottom: 0.5rpx solid rgba(217, 217, 217, 0.6);
			padding-bottom: 40rpx;
			padding-top: 20rpx;

			.parkAmount {
				display: flex;
				padding: 10rpx 0;
				overflow: hidden;

				.icon {
					margin-right: 20rpx;

					image {
						width: 34rpx;
						height: 34rpx;
					}
				}

				.content {
					color: #828282;
				}
			}
		}

		.bottom {}
	}
</style>